package newsEventSystem;

import java.util.ArrayList;
import java.util.List;

public class Domain {
	private String name;
	private Domain parent;
	private List<News> newsList;

	public List<News> getNewsList() {
		return newsList;
	}

	public Domain(String name, Domain parent) {
		this.name = name;
		this.parent = parent;
		newsList = new ArrayList<News>();
	}

	public String getDomainName() {
		return name;
	}

	public String getParentName() {
		if (parent == null) {
			return null;
		}
		return parent.getDomainName();
	}

	public void addNewsToDomain(News aNews) {
		this.newsList.add(aNews);
	}

	public void removeNews(News n) {
		newsList.remove(n);
	}
}
